package com.hanggold.springboot.lesson4;

import org.springframework.boot.SpringApplication;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.core.type.StandardAnnotationMetadata;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.SimpleMetadataReaderFactory;

import java.io.IOException;

public class AnnotationApplication {

    public static void main(String[] args) throws IOException {

        AnnotationMetadata annotationMetadata = new StandardAnnotationMetadata(SpringApplication.class);

        SimpleMetadataReaderFactory simpleMetadataReaderFactory = new SimpleMetadataReaderFactory();

        MetadataReader metadataReader =  simpleMetadataReaderFactory.getMetadataReader(SpringApplication.class.getName());

        System.out.println(annotationMetadata.getAnnotationTypes());


        System.out.println(metadataReader.getAnnotationMetadata().getAnnotationTypes());

    }
}
